"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentPlatfrom = void 0;
var platfrom_1 = require("../type/platfrom");
/** 获取当前应用运行的环境 */
exports.getCurrentPlatfrom = (function () {
    var UA = window.navigator.userAgent;
    if (/(android|iphone|ipad|ipod)/i.test(UA)) {
        if (/MicroMessenger/i.test(UA)) {
            if (/miniprogram/i.test(UA))
                return platfrom_1.EPlatfrom.MINIPROGRAME;
            return platfrom_1.EPlatfrom.WECHAT;
        }
        if (/isApp/i.test(UA)) {
            if (/(iphone|ipad|ipod)/i.test(UA))
                return platfrom_1.EPlatfrom.IOS;
            return platfrom_1.EPlatfrom.ANDROID;
        }
        return platfrom_1.EPlatfrom.MOBILE_WEB;
    }
    return platfrom_1.EPlatfrom.PC_WEB;
})();
